$(function () {
  $('#submit').click(function () {
    $.post("./login", {
      username: $('#username').val(),
      password: $('#password').val()
    }, function (data) {
      if (data) {
        location.href = './index';
      } else {
        alert("用户名或密码错误");
      }
    });
  });
});